Clean up tools/check error reporting. Remove logging.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 2 Sep 2005 09:02:13 +0000 (09:02 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 2 Sep 2005 09:02:13 +0000 (09:02 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/check/check_brctl
tools/check/check_iproute
tools/check/check_logging
tools/check/check_python
tools/check/check_zlib_devel
tools/check/check_zlib_lib
tools/check/chk

index 26f3ce685600b95627319e16db9697ca5e84a17e..6b8250f5cc7daccbcb36c99707549859510fc493 100755 (executable)
@@ -2,8 +2,9 @@
 # CHECK-INSTALL
 
 function error {
-   echo 'Check for the bridge control utils (brctl) failed.'
+   echo
+   echo '  *** Check for the bridge control utils (brctl) FAILED'
    exit 1
 }
 
-brctl show || error
\ No newline at end of file
+which brctl 1>/dev/null 2>&1 || error
index 663e0788e5b0994bdaf4abb30f66f8610465197c..c990349a9b682e0d78be0c64c6579955e0010544 100755 (executable)
@@ -2,9 +2,10 @@
 # CHECK-INSTALL
 
 function error {
-   echo 'Check for iproute (ip addr) failed.'
+   echo
+   echo '  *** Check for iproute (ip addr) FAILED'
    exit 1
 }
 
-ip addr list || error
+ip addr list 1>/dev/null 2>&1 || error
 
index 941ba618bf207dbe3d44d99027f8eed2cb51d042..d9f3ff814a3d8ad4e1d4d8eeef8a2eb9bff22b4f 100755 (executable)
@@ -18,11 +18,12 @@ def check_logging():
         import logging
     except ImportError:
         hline()
-        msg("Python logging is not installed.")
-        msg("Use 'make install-logging' at the xen root to install.")
         msg("")
-        msg("Alternatively download and install from")
-        msg("http://www.red-dove.com/python_logging.html")
+        msg("  *** Python logging is not installed.")
+        msg("  *** Use 'make install-logging' at the xen root to install.")
+        msg("  *** ")
+        msg("  *** Alternatively download and install from")
+        msg("  *** http://www.red-dove.com/python_logging.html")
         hline()
         sys.exit(1)
 
index 321b32dbbe3498d602e301e317a1c7610b4055d2..a217a67141fa94cf6fcd77d5c25004672b40ec71 100755 (executable)
@@ -2,9 +2,9 @@
 # CHECK-BUILD CHECK-INSTALL
 
 function error {
-    echo "Check for Python version 2.2 or higher failed."
+    echo
+    echo "  *** Check for Python version >= 2.2 FAILED"
     exit 1
 }
 
-python -V
 python -V 2>&1 | cut -d ' ' -f 2 | grep -q -E '^2.2|^2.3|^2.4' || error
index 6f6334bcd0e34d264b7de466973558651c031773..4986b4403e194fe96e5a748f59b0fc3eeba2bbdc 100755 (executable)
@@ -2,9 +2,10 @@
 # CHECK-BUILD
 
 function error {
-    echo 'Check for zlib includes failed.'
+    echo
+    echo "  *** Check for zlib headers FAILED"
     exit 1
 }
 
 set -e
-[ -e /usr/include/zlib.h ] || error
\ No newline at end of file
+[ -e /usr/include/zlib.h ] || error
index 4e1937284339ffdc002a7c9f2805d06fafe70a94..8820a30371fd7429c5044bdd4411f352b62d3527 100755 (executable)
@@ -2,9 +2,10 @@
 # CHECK-BUILD CHECK-INSTALL
 
 function error {
-    echo 'Check for zlib library failed.'
+    echo
+    echo "  *** Check for zlib library FAILED"
     exit 1
 }
 
 set -e
-ldconfig -p | grep libz.so || error
\ No newline at end of file
+ldconfig -p | grep -q libz.so || error
index c9b7adead57b3acbb66a0b9f8f26acf8fb252b71..7859760bd7da31a19e35ee7a132e9b85db38ec53 100755 (executable)
@@ -17,14 +17,11 @@ export PATH=${PATH}:/sbin:/usr/sbin
 case $1 in
     build)
         check="CHECK-BUILD"
-        info="/tmp/xen.chkbuild"
         ;;
     install)
         check="CHECK-INSTALL"
-        info="/tmp/xen.chkinstall"
         ;;
     clean)
-        rm -f /tmp/xen.chkbuild /tmp/xen.chkinstall
         exit 0
         ;;
     *)
@@ -34,7 +31,7 @@ esac
 
 failed=0
 
-echo "Xen ${check} " $(date) > ${info}
+echo "Xen ${check} " $(date)
 for f in check_* ; do
     case $f in
         *~)
@@ -49,24 +46,12 @@ for f in check_* ; do
     if ! grep -q ${check} $f ; then
         continue
     fi
-    echo ' ' >> ${info}
-    echo "Checking $f" >> ${info}
-    if ./$f 1>>${info} 2>&1 ; then
-        echo OK >> ${info}
+    echo -n "Checking $f: "
+    if ./$f 2>&1 ; then
+        echo OK
     else
         failed=1
-        echo "FAILED $f"
-        echo FAILED >> ${info}
     fi
 done
 
-echo >> ${info}
-
-if [ "$failed" == "1" ] ; then
-    echo "Checks failed. See `pwd`/${info} for details."
-    echo "FAILED" >> ${info}
-    exit 1
-else
-    echo "OK" >> ${info}
-    exit 0
-fi
+exit $failed